package com.hs.room.mapper

import com.hs.common.dto.SysUserDto
import com.hs.room.model.sys.SysUser
import org.mapstruct.Mapper
import org.mapstruct.factory.Mappers

@Mapper
interface UserMapper {

    // 映射单个 User 到 UserDTO
    fun userToUserDTO(user: SysUser): SysUserDto

    fun userDtoToUser(user: SysUserDto): SysUser

    // 映射 List<User> 到 List<UserDTO>
    fun usersToUserDTOs(users: List<SysUser>): List<SysUserDto>

    // 获取 Mapper 实例
    companion object {
        val INSTANCE: UserMapper = Mappers.getMapper(UserMapper::class.java)
    }


}